package com.design.cjm.creational.builder.example;

/**
 * 指挥者
 *
 * @Author: Jie Ming Chen
 * @Date: 2018/9/23
 * @Version 1.0
 */
public class PersonDirector {

    private PersonBuilder pb;

    /**
     * 用户告诉指挥官,我需要什么样的小人
     *
     * @param pb
     */
    public PersonDirector(PersonBuilder pb) {

        this.pb = pb;
    }

    /**
     * 根据用户的选择建造小人
     */
    public void createPerson() {
        pb.buildHead();
        pb.buildBody();
        pb.buildArmLeft();
        pb.buildArmRight();
        pb.buildLegLeft();
        pb.buildLegRight();
    }

}
